<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:ui>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<link rel="stylesheet" type="text/css" charset="utf-8"
			href="/hrms/css/styles.css" />
		<link rel="stylesheet" type="text/css" charset="utf-8"
			href="/hrms/css/flexigrid.css" />
		<link rel="stylesheet" type="text/css" charset="utf-8"
			href="/hrms/css/flexigrid.pack.css" />
		<link rel="stylesheet" type="text/css" charset="utf-8"
			href="/hrms/css/ztree.css" />

		<script type="text/javascript"
			src="/hrms/js/jquery-1.7.2.min.js"></script>

		<script type="text/javascript"
			src="/hrms/js/jquery.container.js"></script>

		<script type="text/javascript"
			src="/hrms/js/common.js"></script>

		<script type="text/javascript"
			src="/hrms/js/flexigrid.pack.js"></script>

		<script type="text/javascript">
		var dept_setting_add = {
			check: {
				enable: true,
				chkStyle: "radio",
				radioType: "all"
			},
			view: {
				dblClickExpand: false
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				onClick: onClick_dept_add,
				onCheck: onCheck_dept_add
			}
		};
		
		var dept_setting_update = {
			check: {
				enable: true,
				chkStyle: "radio",
				radioType: "all"
			},
			view: {
				dblClickExpand: false
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				onClick: onClick_dept_update,
				onCheck: onCheck_dept_update
			}
		};
		 var zDeptNodes =[
			{id:1, pId:0, name:"总经理办公室"},
			{id:2, pId:0, name:"财务部"},
			{id:4, pId:0, name:"软件研发部"}
		 ];
		 
		 function onClick_dept_add(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("dept_treeDemo_add");
			zTree.checkNode(treeNode, !treeNode.checked, null, true);
			return false;
		}
		
		function onClick_dept_update(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("dept_treeDemo_update");
			zTree.checkNode(treeNode, !treeNode.checked, null, true);
			return false;
		}
		function onCheck_dept_add(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("dept_treeDemo_add"),
			nodes = zTree.getCheckedNodes(true),
			v = "";
			for (var i=0, l=nodes.length; i<l; i++) {
				v += nodes[i].name + ",";
			}
			if (v.length > 0 ) v = v.substring(0, v.length-1);
			var cityObj = $("#deptid_add");
			cityObj.attr("value", v);
		}
		
		function onCheck_dept_update(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("dept_treeDemo_update"),
			nodes = zTree.getCheckedNodes(true),
			v = "";
			for (var i=0, l=nodes.length; i<l; i++) {
				v += nodes[i].name + ",";
			}
			if (v.length > 0 ) v = v.substring(0, v.length-1);
			var cityObj = $("#deptid_update");
			cityObj.attr("value", v);
		}
 
		function showMenu_dept_add() {
			var cityObj = $("#deptid_add");
			var cityOffset = $("#deptid_add").offset();
			$("#dept_menuContent_add").slideDown("fast");
 
			$("body").bind("mousedown", onBodyDown_dept_add);
		}
		
		function showMenu_dept_update() {
			var cityObj = $("#deptid_update");
			var cityOffset = $("#deptid_update").offset();
			$("#dept_menuContent_update").slideDown("fast");
 
			$("body").bind("mousedown", onBodyDown_dept_update);
		}
		function hideMenu_dept_add() {
			$("#dept_menuContent_add").fadeOut("fast");
			$("body").unbind("mousedown", onBodyDown_dept_add);
		}
		
		function hideMenu_dept_update() {
			$("#dept_menuContent_update").fadeOut("fast");
			$("body").unbind("mousedown", onBodyDown_dept_update);
		}
			function onBodyDown_dept_add(event) {
			if (!(event.target.id == "menuBtn" || event.target.id == "deptid_add" || event.target.id == "dept_menuContent_add" || $(event.target).parents("#dept_menuContent_add").length>0)) {
				hideMenu_dept_add();
			}
		}
		
		function onBodyDown_dept_update(event) {
			if (!(event.target.id == "menuBtn" || event.target.id == "deptid_update" || event.target.id == "dept_menuContent_update" || $(event.target).parents("#dept_menuContent_update").length>0)) {
				hideMenu_dept_update();
			}
		}
		
			var empl_setting_add = {
			check: {
				enable: true,
				chkStyle: "radio",
				radioType: "all"
			},
			view: {
				dblClickExpand: false
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				onClick: onClick_empl_add,
				onCheck: onCheck_empl_add
			}
		};
		var zEmplNodes =[
			{id:4, pId:0, name:"软件研发部", open:true, nocheck:true},
			{id:41, pId:4, name:"A君"},
			{id:42, pId:4, name:"B君"},
			{id:43, pId:4, name:"C君"}
		 ];
		 function onClick_empl_add(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("empl_treeDemo_add");
			zTree.checkNode(treeNode, !treeNode.checked, null, true);
			return false;
		}
		function onCheck_empl_add(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("empl_treeDemo_add"),
			nodes = zTree.getCheckedNodes(true),
			v = "";
			for (var i=0, l=nodes.length; i<l; i++) {
				v += nodes[i].name + ",";
			}
			if (v.length > 0 ) v = v.substring(0, v.length-1);
			var cityObj = $("#empl_add");
			cityObj.attr("value", v);
		}
		function showMenu_empl_add() {
			var cityObj = $("#empl_add");
			var cityOffset = $("#empl_add").offset();
			$("#empl_menuContent_add").slideDown("fast");
 
			$("body").bind("mousedown", onBodyDown_empl_add);
		}
		function hideMenu_empl_add() {
			$("#empl_menuContent_add").fadeOut("fast");
			$("body").unbind("mousedown", onBodyDown_empl_add);
		}
		function onBodyDown_empl_add(event) {
			if (!(event.target.id == "menuBtn" || event.target.id == "empl_add" || event.target.id == "empl_menuContent_add" || $(event.target).parents("#empl_menuContent_add").length>0)) {
				hideMenu_empl_add();
			}
		}
		
	$(document).ready( function() {
		$.fn.zTree.init($("#dept_treeDemo_add"), dept_setting_add, zDeptNodes);
		$.fn.zTree.init($("#dept_treeDemo_update"), dept_setting_update, zDeptNodes);
		
		$.fn.zTree.init($("#empl_treeDemo_add"), empl_setting_add, zEmplNodes);
		demand("contmgr");
		$("#add").click(function(){
			$("#cont_add").dialog("close");
		});
		$("#update").click(function(){
			$("#cont_update").dialog("close");
		});
		$("#cont_update").dialog("close");
		$("#cont_add").dialog("close");
	});
</script>

	</head>

	<body onload="loadDemand('contmgr')">
		<div align="center">
			<br />
			<br />
			<br />
			<table width="80%" border="0" class="table_frame" align="center">

				<thead class="table_title">
					<tr>
						<td align="center">
							劳动合同信息管理
						</td>
					</tr>
				</thead>
				<tr>
					<td>
						<table width="100%" border="0" class="table_block">
							<tr>
								<td align="right">
									员工编号：
								</td>
								<td align="left">
									<input name="" type="text" size="20" />
									&nbsp;
								</td>
								<td align="right">
									员工姓名：
								</td>
								<td align="left">
									<input name="Input" type="text" size="20" />
								</td>
							</tr>
							<tr>
								<td colspan="4" align="center">
									<input name="" type="button" value="查询" class="button_image" />
									<input name="" type="reset" class="button_image" />
								</td>

							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td height="20"></td>
				</tr>
				<tr>
					<td>
						<div>
							<table id="querylist"></table>
							<script type="text/javascript">
	$("#querylist").flexigrid( {
		url :'post2.php',
		dataType :'json',
		colModel : [ {
			display :'员工编号',
			name :'iso',
			width :160,
			sortable :true,
			align :'center'
		}, {
			display :'员工姓名',
			name :'name',
			width :180,
			sortable :true,
			align :'left'
		}, {
			display :'所在部门',
			name :'printable_name',
			width :120,
			sortable :true,
			align :'left'
		}, {
			display :'司龄',
			name :'iso3',
			width :130,
			sortable :true,
			align :'left',
			hide :true
		}, {
			display :'状态',
			name :'numcode',
			width :80,
			sortable :true,
			align :'right'
		},{
			display :'起始日期',
			name :'numcode',
			width :80,
			sortable :true,
			align :'right'
		},{
			display :'结束日期',
			name :'numcode',
			width :80,
			sortable :true,
			align :'right'
		},{
			display :'合同种类',
			name :'numcode',
			width :80,
			sortable :true,
			align :'right'
		},{
			display :'期限',
			name :'numcode',
			width :80,
			sortable :true,
			align :'right'
		} ],
		buttons : [ {
			name :'创建合同信息',
			bclass :'add',
			onpress :add
		}, {
			name :'合同信息编辑',
			bclass :'edit',
			onpress :update
		}, {
			name :'续签合同',
			bclass :'edit',
			onpress :renew
		}, {
			name :'解除合同',
			bclass :'relieve',
			onpress :relieve
		}, {
			name :'删除合同信息',
			bclass :'delete',
			onpress :remove
		}, {
			separator :true
		} ],
		searchitems : [ {
			display :'员工编号',
			name :'iso'
		}, {
			display :'员工姓名',
			name :'name',
			isdefault :true
		} ],
		sortname :"iso",
		sortorder :"asc",
		usepager :true,
		title :'劳动合同信息列表',
		funcp :true,
		rp :15,
		showTableToggleBtn :true,
		width :1000,
		height :200
	});
	function add(com, grid) {
		$("#cont_add").dialog("open");
	}
	function update(com, grid) {
		$("#cont_update").dialog("open");
	}
	function remove(com, grid) {
		alert("请先选择您要删除的数据！");
	}
	function relieve(com,grid){
		alert("请选择需要解除的合同！");
	}
	function renew(com,grid){
		alert("请选择需要续签的合同！");
	}
</script>
						</div>
					</td>
				</tr>
			</table>
			<div align="center">
				<br />
				<br />
				<table width="90%" border="0" class="table_frame" align="center">
					<tr>
						<td align="center">
							<input id="demand" name="" type="button" value="需求收集"
								class="button_image" />
						</td>
					</tr>
					<tr>
						<td align="center">
							<div id="demand_input" style="display: none">
								<textarea rows="15" cols="120" id="demand_text"></textarea>
								<br />
								<input id="demand_save" type="button" class="button_image"
									value="保存需求" />
							</div>
						</td>
					</tr>
				</table>
				<table id="demand_des" width="90%" border="0" class="table_frame"
					align="center">
					<thead align="center" class="table_title">
						<tr>
							<td>
								需求描述
							</td>
						</tr>
					</thead>
				</table>
			</div>
		</div>
		<ui:dialog id="cont_add" title="合同新增" height="300" width="700"
			modal="true">
			<form id="aform"
				action="/eaip/webservice/resources/session/login"
				method="post">
				<table class="table_frame" width="100%">
					<tr>
						<td align="right">
							员工姓名:
						</td>
						<td align="left">
							<input id="empl_add" type="text" readonly="readonly" value=""
								size=20 onclick="showMenu_empl_add();" />
							<div id="empl_menuContent_add" class="empl_menuContent_add"
								style="display: none; position: absolute;">
								<ul id="empl_treeDemo_add" class="ztree"
									style="margin-top: 0; width: 180px; height: 100px;"></ul>
							</div>
							<font color="red">*</font>
						</td>
						<td align="right">
							员工状态:
						</td>
						<td align="left">
							<select>
								<option>试用</option>
								<option>正式</option>
								<option>离职</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">
							司龄:
						</td>
						<td align="left">
							1
						</td>
						<td align="right">
							所在部门:
						</td>
						<td align="left">
							<input id="deptid_add" type="text" readonly="readonly" size="20"
								onclick="showMenu_dept_add();" ondblclick="this.value='';" />
							<div id="dept_menuContent_add" class="dept_menuContent_add"
								style="display: none; position: absolute;">
								<ul id="dept_treeDemo_add" class="ztree"
									style="margin-top: 0; width: 180px; height: 100px;"></ul>
							</div>
							<font color="red">*</font>
						</td>
					</tr>
					<tr>
						<td align="right">
							状态:
						</td>
						<td align="left">
							<select>
								<option>
									有效/无效
								</option>
							</select>
						</td>
						<td align="right">
							起始日期:
						</td>
						<td align="left">
							<ui:datepicker id="sdate" />
						</td>
					</tr>
					<tr>
						<td align="right">
							结束日期:
						</td>
						<td align="left">
							<ui:datepicker id="edate" />
						</td>
						<td align="right">
							合同种类:
						</td>
						<td align="left">
							<select>
								<option value="">
									合同种类字典
								</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">
							期限:
						</td>
						<td align="left">
							<select>
								<option value="">
									有期限/无期限
								</option>
							</select>
						</td>
						<td align="right">
							社保增员时间:
						</td>
						<td align="left">
							<ui:datepicker id="ssAddDate" />
						</td>
					</tr>
					<tr>
						<td align="right" colspan="2">
							<input type="button" value="保存" class="button_image" id="add" />
						</td>
						<td align="left" colspan="2">
							<input type="reset" value="重置" class="button_image" />
						</td>
					</tr>
				</table>
			</form>
		</ui:dialog>
		<ui:dialog id="cont_update" title="合同修改" height="300" width="700"
			modal="true">
			<form id="aform"
				action="/eaip/webservice/resources/session/login"
				method="post">
				<table class="table_frame" width="100%">
					<tr>
						<td align="right">
							员工姓名:
						</td>
						<td align="left">
							毛寿贤
						</td>
						<td align="right">
							员工状态:
						</td>
						<td align="left">
							<select>
								<option>试用</option>
								<option>正式</option>
								<option>离职</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">
							司龄:
						</td>
						<td align="left">
							1
						</td>
						<td align="right">
							所在部门:
						</td>
						<td align="left">
							<input id="deptid_update" type="text" readonly="readonly" size="20"
								onclick="showMenu_dept_update();" ondblclick="this.value='';" />
							<div id="dept_menuContent_update" class="dept_menuContent_update"
								style="display: none; position: absolute;">
								<ul id="dept_treeDemo_update" class="ztree"
									style="margin-top: 0; width: 180px; height: 100px;"></ul>
							</div>
							<font color="red">*</font>
						</td>
					</tr>
					<tr>
						<td align="right">
							状态:
						</td>
						<td align="left">
							<select>
								<option>
									有效/无效
								</option>
							</select>
						</td>
						<td align="right">
							起始日期:
						</td>
						<td align="left">
							<ui:datepicker id="sdate" />
						</td>
					</tr>
					<tr>
						<td align="right">
							结束日期:
						</td>
						<td align="left">
							<ui:datepicker id="edate" />
						</td>
						<td align="right">
							合同种类:
						</td>
						<td align="left">
							<select>
								<option value="">
									合同种类字典
								</option>
							</select>
						</td>
					</tr>
					<tr>
						<td align="right">
							期限:
						</td>
						<td align="left">
							<select>
								<option value="">
									有期限/无期限
								</option>
							</select>
						</td>
						<td align="right">
							社保增员时间:
						</td>
						<td align="left">
							<ui:datepicker id="ssAddDate" />
						</td>
					</tr>
					<tr>
						<td align="right" colspan="2">
							<input type="button" value="保存" class="button_image" id="update" />
						</td>
						<td align="left" colspan="2">
							<input type="reset" value="重置" class="button_image" />
						</td>
					</tr>
				</table>
			</form>
		</ui:dialog>
	</body>
</html>
